--- a/configure
+++ b/configure
@@ -246,7 +246,7 @@ EOF
 
 check_elf()
 {
-    if ${PKG_CONFIG} libelf --exists; then
+    if [ "${HAVE_ELF}" = "y" ] && ${PKG_CONFIG} libelf --exists; then
 	echo "HAVE_ELF:=y" >>$CONFIG
 	echo "yes"
 
